package com.xzp.blog.entity.dto.form;

import com.xzp.blog.consts.DataConsts;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;

/**
 * 注册表单
 */
public class UserRegisterForm {

    /**
     * 用户名
     */
    @Length(max = DataConsts.USERNAME_MAX_LENGTH)
    @NotEmpty(message = "用户名不能为空")
    private String username;

    /**
     * 密码
     */
    @Length(max = DataConsts.PASSWORD_MAX_LENGTH)
    @NotEmpty(message = "密码不能为空")
    private String password;

    /**
     * 确认密码
     */
    @Length(max = DataConsts.PASSWORD_MAX_LENGTH)
    @NotEmpty(message = "请再次确认密码")
    private String confirmpassword;

    public UserRegisterForm(String username, String password, String confirmpassword) {
        this.username = username;
        this.password = password;
        this.confirmpassword = confirmpassword;
    }

    public UserRegisterForm() {
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getConfirmpassword() {
        return confirmpassword;
    }

    public void setConfirmpassword(String confirmpassword) {
        this.confirmpassword = confirmpassword;
    }
}
